local xianyan = fk.CreateSkill{
  name = "rfenghou_3d17j__xianyan",
  attached_skill_name = "rfenghou_3d17j__xianyan&"
}

xianyan:addAcquireEffect(function (self, player)
  local room = player.room
  for _, p in ipairs(room:getOtherPlayers(player, false)) do
    if p:isMale() then
      room:handleAddLoseSkills(p, xianyan.attached_skill_name, nil, false, true)
    else
      room:handleAddLoseSkills(p, "-" .. xianyan.attached_skill_name, nil, false, true)
    end
  end
end)

xianyan:addEffect(fk.AfterPropertyChange, {
  can_refresh = function(self, event, target, player, data)
    return target == player
  end,
  on_refresh = function(self, event, target, player, data)
    local room = player.room
    if player:isMale() and table.find(room.alive_players, function (p)
      return p ~= player and p:hasSkill(xianyan.name, true)
    end) then
      room:handleAddLoseSkills(player, xianyan.attached_skill_name, nil, false, true)
    else
      room:handleAddLoseSkills(player, "-" .. xianyan.attached_skill_name, nil, false, true)
    end
  end,
})

Fk:loadTranslationTable{
  ["rfenghou_3d17j__xianyan"] = "献艳",
  [":rfenghou_3d17j__xianyan"] = "其他男性角色每局游戏限一次，其可于其出牌阶段将性别改为女，然后以自己替换“神·董卓”身下的武将牌。<br>" ..
  "<a href=':programmer_rfenghou_3d17j__xianyan'>实际上……？</a>",

  [":programmer_rfenghou_3d17j__xianyan"] = "其他男性角色限一次，其可于其出牌阶段将性别改为女，然后以其主将交换你的第已损失体力值张“娇”。",
}

return xianyan
